//
//  FirstViewController.m
//  Streaming
//
//  Created by 韩一博 on 15/6/27.
//  Copyright (c) 2015年 liuxun. All rights reserved.
//

#import "FirstViewController.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)dealloc
{
    [self.titleLabel release];
    [self.labelText release];
    
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.title = @"流媒体资讯";
    [self.view setBackgroundColor:[UIColor whiteColor]];
    [self addAllViews];
    
    [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:31/255.0 green:115/255.0 blue:192/255.0 alpha:0.3]];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"iconfont-unie642.png"] style:UIBarButtonItemStyleDone target:self action:@selector(leftBarButtonItemAction)];
    self.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor];
    
    
}
- (void)leftBarButtonItemAction
{
    [self.navigationController popViewControllerAnimated:YES];
}


#pragma mark 添加全部控件
- (void)addAllViews
{
    NSInteger x_width = self.view.frame.size.width;
    NSInteger y_height = self.view.frame.size.height;
    
    self.titleLabel = [[[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 3., 20. / 568 * y_height, 100. / 320 * x_width , 40. / 568 * y_height )] autorelease];
    _titleLabel.text = @"离线说明";
    _titleLabel.font = [UIFont boldSystemFontOfSize:20];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:_titleLabel];
    
    self.labelText = [[[UILabel alloc] initWithFrame:CGRectMake(20 , 60. / 568 * y_height  , [UIScreen mainScreen].bounds.size.width - 40, 450 / 568. * y_height )] autorelease];
    
    //    _labelText.adjustsFontSizeToFitWidth = YES;
    _labelText.numberOfLines = 0;
    _labelText.textAlignment = NSTextAlignmentLeft;
    _labelText.text = @"      流媒体资讯为一款可以看最近热映和即将上映的电影APP，里面还包括电影的一些精彩的预告片与花絮，还有关于你们喜欢的一些影星。一些经典的老片会给你们带来以前看时候的滋味，还有关于时下一些热点新闻，让使用者可以知道大家都在讨论什么好的电影，让使用者体会到这不仅仅是一款电影软件而是全方面的APP。\n特别提醒：\n      一些电影的预告视频请用户可以在有wifi时候使用（土豪除外）。\n谢谢大家使用，如果有什么问题请致电邮箱。";
    _labelText.font = [UIFont systemFontOfSize:16];
    NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:_labelText.text];
    NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle1 setLineSpacing:8];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [_labelText.text length])];
    [_labelText setAttributedText:attributedString1];
    [_labelText sizeToFit];
    [self.view addSubview:_labelText];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
